<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="generator" content="editplus" />
  <meta name="author" content="" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
<link href="<?=base_url()?>assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url()?>assets/css/Public.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url()?>assets/css/all.css" rel="stylesheet" type="text/css" />
<link href="<?=base_url()?>assets/css/wanwan.css" rel="stylesheet" type="text/css" />

<title>湾湾网-简单就是分享</title>
<script type="text/javascript" src="<?=base_url()?>assets/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="<?=base_url()?>assets/js/jquery-ui-1.10.2.custom.min.js"></script>
<script type="text/javascript" src="<?=base_url()?>assets/js/operate.js"></script>
<script type="text/javascript" src="<?=base_url()?>assets/js/wanwanutil.js"></script>
<script type="text/javascript" src="<?=base_url()?>assets/js/register.js"></script>
<script type="text/javascript">
	$(function() {
		$("#optimistic").click(function() {
			$.ajax({
				type:"POST",
				url:"<?=base_url()?>index.php/team/optimistic",
				data:"teamId=<?=$rs['teamId']?>",
				success:function() {
					$("#user_optimistic").html(<?=$rs['optimistic']?>+1);
					$("#optimistic").unbind("click");
				}
			});
		});
		$("#care").click(function() {
			$.ajax({
				type:"POST",
				url:"<?=base_url()?>index.php/team/care",
				data:"teamId=<?=$rs['teamId']?>",
				success:function() {
					$("#user_care").html(<?=$rs['care']?>+1);
					$("#care").unbind("click");
				}
			});
		});
		$("#applyToTeam").click(function() {
			$.ajax({
				type:"POST",
				url:"<?=base_url()?>index.php/team/applyJoinToTeam",
				data:"teamId=<?=$rs['teamId']?>",
				success:function() {
					alert("申请成功");
				}
			});
		});
		/*
		$("#tdzy_rgd2").load("<?=base_url()?>index.php/team/dynamic_links/2/picture");
		*/
		$("#link_ul li").each(function() {
			$(this).click(function() {
				$("#moreList").attr("title",1);
				$(this).addClass("on").siblings().removeClass("on");
				var title = $(this).attr("title");
				$(".tdContent").addClass("div_display");
				$("#moreList").removeClass("div_display");
				$("#tdzy_rgd2").load("<?=base_url()?>index.php/team/dynamic_links/<?=$rs['teamId']?>/"+title+"/1");
			});
		});
		
		$("#team_editNotice").click(function(){
			var content = $("#team_notice").html();
			window.content = content;
			content = '<form><textarea style="width:100%;" id="area_notice">' + content + '</textarea></form>';
			$("#team_notice").html(content);
			$("#team_editNotice").addClass("div_display");
			$("#saveAndCancel").removeClass("div_display");
		});
		$("#btn_cancel").click(function() {
			$("#team_notice").html(window.content);
			$("#saveAndCancel").addClass("div_display");
			$("#team_editNotice").removeClass("div_display");
		});
		$("#btn_save").click(function() {
			var new_content = $("#area_notice").val();
			$("#team_notice").html(new_content);
			$("#saveAndCancel").addClass("div_display");
			$("#team_editNotice").removeClass("div_display");
			$.ajax({
				type:"POST",
				url:"<?=base_url()?>index.php/team/updateDynamicNotice",
				data:"teamId=<?=$rs['teamId']?>&content="+new_content
			});
		});
		
		$("#team_editDesc").click(function(){
			var content = $("#teamDesc").html();
			window.content = content;
			content = '<form><textarea style="width:100%;" id="area_desc">' + content + '</textarea></form>';
			$("#teamDesc").html(content);
			$("#team_editDesc").addClass("div_display");
			$("#saveAndCancel_tdjj").removeClass("div_display");
		});
		$("#btn_cancel_tdjj").click(function() {
			$("#teamDesc").html(window.content);
			$("#saveAndCancel_tdjj").addClass("div_display");
			$("#team_editDesc").removeClass("div_display");
		});
		$("#btn_save_tdjj").click(function() {
			var new_content = $("#area_desc").val();
			$("#teamDesc").html(new_content);
			$("#saveAndCancel_tdjj").addClass("div_display");
			$("#team_editDesc").removeClass("div_display");
			$.ajax({
				type:"POST",
				url:"<?=base_url()?>index.php/team/updateDynamicDesc",
				data:"teamId=<?=$rs['teamId']?>&content="+new_content
			});
		});
		$("#moreList").click(function(){
			$(".dynamic_reply").each(function() {
				$(this).unbind("click");
			});
			var pageNo=$(this).attr("title");
			
			var selectType;
			$("#link_ul li").each(function() {
				if($(this).hasClass("on")){
					selectType = $(this).attr("title");
				}
			});
			$.post("<?=base_url()?>index.php/team/dynamic_links/"+<?=$rs['teamId']?>+"/"+selectType+"/"+pageNo,{},function(data){
				$("#tdzy_rgd2").append(data);
			},"html");
			
			pageNo=parseInt(pageNo);
			$(this).attr("title",pageNo+1);
		});
	});
</script>
</head>

<body>
<div class="wrap">
	<div class="header">
		<div class="head">
			<h1 style="background:url(<?=base_url()?>assets/images/logo.png) no-repeat; width:280px; height:60px;"></h1>
			<ul>
				<li class="houmepage"><a href="#" class="sy"><strong>首页</strong></a></li>
				<li><a href="#"><strong>我的主页</strong></a></li>
				<li><a href="#"><strong>团队主页</strong></a></li>
				<li><a href="#"><strong>+</strong></a></li>
			</ul>
			<div class="head_rg">
				<div class="search">
					<input type="text" class="sch_txt" />
					<input type="button" class="sch_but" />
				</div>
                <div  class="misc-action">
                <ul class="action-list">
                <li class="action-item"> <a class="action-link inbox"  title="发现">发现</a></li>
                <li class="action-item"><a class="action-link settings" href="" title="帐户">帐户</a></li>
                <li class="action-item"><a class="action-link logout" href="" title="退出">退出</a></li>
                </ul>
                </div>
			</div>
		</div>
	</div><!-- end header -->
	<div class="content">
		<div class="tdzy_lf">
			<div class="tdzy_lfd1">
                <div class="tdzy_img"></div>
				<h3><?=$rs['teamName']?></h3>
				<p class="tdzy_p1"><a href="javascript:void(0);" id="care">+在意</a>(<span id="user_care"><?=$rs['care']?></span>)</p>
				<p class="tdzy_p1"><a href="javascript:void(0);" id="optimistic">+看好</a>(<span id="user_optimistic"><?=$rs['optimistic']?></span>)</p>
				<p class="tdzy_p2"><input type="button" id="applyToTeam" class="tdzy_put"/></p>
			</div>
			
			<div class="bmlf_lf1">
				<ul>
					<li class="lf1_hover1"><a href="#"><strong>年鉴</strong></a></li>
					<li class="lf1_hover2"><a href="#"><strong>照片墙</strong></a></li>
					<li class="lf1_hover8"><a href="#"><strong>团体成员</strong></a></li>
				</ul>
			</div><!-- end bmlf_lf1 -->
		</div><!-- end tdzy_lf -->
		<div class="tdzy_rg">
			<div class="tdzy_rgd1">
				<div class="tdzy_rd1"></div>
				<div class="tdzy_rd2">
					<div class="tdzy_rd21">
						<div class="tdzy_rdimg"><img src="<?=base_url()?>assets/images/tdzy_04.gif" width="30" height="34"/></div>
						<div class="tdjj">
							<h2><span><strong>-</strong></span>团队简介</h2>
							<p>
								<span id="teamDesc"><?=$rs['teamDescription']?></span>
								<span id="team_editDesc" class="edit_td">
									<a href="javascript:void(0);" class="edit_color">编辑</a>
								</span>
								<span id="saveAndCancel_tdjj" class="div_display edit_td">
									<a href="javascript:void(0);" class="edit_color" id="btn_save_tdjj">保存</a>
									<a href="javascript:void(0);" class="edit_color" id="btn_cancel_tdjj">取消</a>
								</span>
							</p>
						</div>
					</div>
					<div class="tdzy_rd21 tdzy_rd22">
						<div class="tdzy_rdimg"><img src="<?=base_url()?>assets/images/tdzy_05.gif" width="46" height="36" /></div>
						<div class="tdjj">
							<h2><span><strong>-</strong></span>团队公告</h2>
							<p>
								<span id="team_notice"><?=$rs['teamNotice']?></span>
								<span id="team_editNotice" class="edit_td">
									<a href="javascript:void(0);" class="edit_color">编辑</a>
								</span>
								<span id="saveAndCancel" class="div_display edit_td">
									<a href="javascript:void(0);" class="edit_color" id="btn_save">保存</a>
									<a href="javascript:void(0);" class="edit_color" id="btn_cancel">取消</a>
								</span>
							</p>
						</div>
					</div>
				</div>
				<div class="tdzy_rd3"></div>
			</div><!-- end tdzy_rgd1 -->
            <div class="clear"></div>
            <div class="nav_area">
			<ul id="link_ul">
				<li class="on" title="picture"><div class="nav_01"></div></li>
				<li title="text"><div class="nav_02"></div></li>
				<li title="links"><div class="nav_03"></div></li>
				<li title="video"><div class="nav_04"></div></li>
			</ul>
		</div>
			<div class="tdzy_rgd2" id="tdzy_rgd2"> 
				<div class="rgd2_d1"></div>
				<div class="rgd2_d2">
					<div class="sead2_1"><img src="<?=base_url()?>assets/<?=$ud['headIcon']?>" width="62" height="62" /></div>
					<div class="sead2_2 tdzy_rig2">
						<p class="sead2_p1"><?=$ud['createTime']?></p>
						<!--p class="sead2_p2"><strong class="sead2_stg1">NEMON摄影</strong> <strong class="sead2_stg2"><?=$ud['nickName']?> ： 发布展示 ></strong> <strong class="sead2_stg3">LNB-XG-02</strong></p-->
						<p class="sead2_p2"><strong class="sead2_stg2"><?=$ud['nickName']?> ： 发布展示 ></strong></p>
						<p class="sead2_p3"><?=$ud['description']?></p>
						<div style="width:100%" class="div_display" id="div_display_<?=$ud['id']?>">
							<form id="replyForm" method="post" action="<?=base_url()?>index.php/team/replayUsersDynamic">
								<textarea name="reply_content" id="reply_content_<?=$ud['id']?>" rows="7" style="width:630px;"></textarea>
								<input type="hidden" name="dynamicId" id="dynamicId_<?=$ud['id']?>" value="<?=$ud['id']?>"/>
								<input type="button" class="send_btn" title="<?=$ud['id']?>" style="float:right;margin-top:10px;">
							</form>
						</div>
						<p class="sead2_p4 tdzy_rip2">
							<span>
								<a href="javascript:void(0);" class="dynamic_reply" title="<?=$ud['id']?>"><strong class="sead2_stg5">回应(<?=$ud['replyCount']?>)</strong></a>
								<a href="javascript:void(0);" class="dynamic_forward" title="<?=$ud['id']?>"><strong class="sead2_stg5">转发</strong></a>
							</span>
						</p>
					</div>	
				</div>
				<div class="rgd2_d3"></div>
			</div>
			
		<?php
			foreach($dynamicReply as $dr) {
		?>
			<div class="tdzy_rgd2 tdContent"> 
				<div class="rgd2_d1"></div>
				<div class="rgd2_d2">
					<div class="sead2_1"><img src="<?=base_url()?>assets/<?=$dr['headIcon']?>" width="62" height="62" /></div>
					<div class="sead2_2 tdzy_rig2">
						<p class="sead2_p1">回复人：<?=$dr['nickName']?></p>
						<p class="sead2_p2"></p>
						<p class="sead2_p3"><?=$dr['reply_content']?></p>
						<p class="sead2_p4 tdzy_rip2">
							<span>
								<a href="javascript:void(0);" class="dynamic_reply"><strong class="sead2_stg5"><?=$dr['reply_time']?></strong></a>
							</span>
						</p>
					</div>	
				</div>
				<div class="rgd2_d3"></div>
			</div>
		<?php
			}
		?>
	<div class="moreFoot">
		<a href="javascript:void(0);" title="2" class="c_tx" id="moreList" class="div_display">更多<<< </a>
	</div>		
		</div><!-- end tdzy_rg -->
	</div><!-- end content -->
	<div class="footer">
		<p class="foot_p">Copyright © 2013 湾湾网. All Rights Reserved. 冀ICP备12021992号</p>
	</div>
</div><!-- end wrap -->
</body>
</html>
